{extend name="public:layout" /}
{block name="title"}编辑{$moudleName}{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li>
                    <i class="fa fa-hand-o-right"></i>
                    <a href="{:url('index',['mid'=>$Request.param.mid,'cid'=>$Request.param.cid])}">{$moudleName}列表</a>
                </li>
                <li class="active">编辑{$moudleName}</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <input type="hidden" name="order_client" value="{$info.order_client}" />
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">车辆信息</label>
                    <div class="col-sm-3">
                        <input type="text" name="car_sn" id="select-car_sn" placeholder="请选择车辆" data-init="{$info.car_sn}" style="width:100%;" />
                        <script>
                            In('selectpage',function(){
                                var dom=$('#select-car_sn');
                                dom.selectPage({
                                    keyField:'car_sn',
                                    showField:'car_sn',
                                    multiple:false,
                                    pagination:true,
                                    dbTable:'car',
                                    data:'/plus/ajax/selectpage',
                                    andOr:'OR',
                                    params : function(){return {'searchField':'car_sn'}},
                                    eAjaxSuccess : function(data){
                                        if(data.totalRow>0){
                                            return data;
                                        }else{
                                            return false;
                                        }
                                    },
                                    eSelect:function (data) {
                                        //选中后回调
                                    }
                                });
                            })
                        </script>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">客户信息</label>
                    <div class="col-sm-3">
                        <p class="form-control-static">{$info.order_client}（{$info.order_phone}）</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">出发时间</label>
                    <div class="col-sm-3">
                        <input class="form-control laydatetime" type="text" placeholder="出发时间" name="order_start_time" value="{$info.order_start_time}" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">结束时间</label>
                    <div class="col-sm-3">
                        <input class="form-control laydatetime" type="text" placeholder="结束时间" name="order_end_time" value="{$info.order_end_time}" />
                    </div>
                    <script>formatDate();</script>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">订单费用</label>
                    <div class="col-sm-3">
                        <input class="form-control" type="text" placeholder="订单费用" name="order_charge" value="{$info.order_charge}" datatype="*" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">已付款</label>
                    <div class="col-sm-3">
                        <input class="form-control" type="text" placeholder="" name="order_advance" value="{$info.order_advance}" readonly datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">出发地</label>
                    <div class="col-sm-3">
                        <input class="form-control" type="text" placeholder="出发地" name="order_start_adress" value="{$info.order_start_adress}" datatype="*" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">目的地</label>
                    <div class="col-sm-3">
                        <input class="form-control" type="text" placeholder="目的地" name="order_end_adress" value="{$info.order_end_adress}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">备注</label>
                    <div class="col-sm-8">
                        <textarea class="form-control" rows="3" name="fleet_desc" >{$info.fleet_desc}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" id="btnSub" type="button">保存</button>
                        <a href="{:url('index',['mid'=>$Request.param.mid])}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        formatDate();
        ajaxSubForm('#btnSub');
        $("#is_customer_add").on('ifChanged', function(event){
            if($(this).prop('checked')){
                $('.customer').show();
            }else{
                $('.customer').hide();
            }
        });
    });
</script>
{/block}